WinAPE Z80 Assembler V1.0.13

000001  0000  (BB5A)        PrintChar equ &BB5A ; Firmware call to print character in a to location
000002  0000  (BB75)        Locate equ &BB75    ; Firmware call, directly equiv to LOCATE xy in hl
000003  0000  (002A)        Asterix equ 42
000005  0000  (1200)        org &1200
000006  1200  0E 01          ld c, 1    ; Set counter to start
000007  1202  DD 21 26 12    ld ix, xpos        ; Begin by pointing to first entry
000009  1206                MainLoop
000010  1206                ; work out x position as 20 - (#stars / 2)
000011  1206  3E 14          ld a, 20
000012  1208  DD 5E 00       ld e, (ix)
000013  120B  CB 2B          sra e              ; divide by 2
000014  120D  93             sub e
000015  120E                ; The firmware LOCATE call expects x in h and y in l with
000016  120E                ; origin of 1,1 top-right
000017  120E  67             ld h, a
000018  120F  69             ld l, c
000019  1210  CD 75 BB       call Locate
000020  1213  DD 46 00       ld b, (ix)         ; Grab the number of stars and use this for loop
000021  1216  3E 2A          ld a, Asterix              ; PrintChar firmware expects chr in a
000023  1218                InnerRepeat
000024  1218  CD 5A BB       call PrintChar
000025  121B  10 FB          djnz, InnerRepeat  ; And loop the print 
000027  121D                ; Move on to the next row. If we're on row 15, return otherwise NEXT
000028  121D  0C             inc c
000029  121E  3E 0F          ld a, 15
000030  1220  B9             cp c
000031  1221  C8             ret z
000032  1222  DD 23          inc ix
000033  1224  18 E0          jr MainLoop        ; NEXT
000035  1226                xpos
000035  1226  01 03 05 07    db 1,3,5,7,3,7,11,15,5,11,17,23,3,3
        122A  03 07 0B 0F 
        122E  05 0B 11 17 
        1232  03 03 
